package crp.core.security.app;

import crp.core.security.domain.services.RoleEditor;
import crp.core.security.domain.services.RoleSearcher;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

@ApplicationScoped
public class RoleService {
    private Instance<RoleSearcher> roleSearcher;
    private Instance<RoleEditor> roleEditor;

    @Inject
    public RoleService(Instance<RoleSearcher> roleSearcher,
                       Instance<RoleEditor> roleEditor) {
        this.roleSearcher = roleSearcher;
        this.roleEditor = roleEditor;
    }

    public RoleSearcher searcher() {
        return roleSearcher.get();
    }

    public RoleEditor editor() {
        return roleEditor.get();
    }
}
